import java.util.Random;

public class MathPracticeV02 {
    public static void main(String[] args) {
        Random random = new Random();
        for (int i = 0; i < 50; i++) {
            int num1 = random.nextInt(100) + 1; // 保证不小于1
            int num2 = random.nextInt(100) + 1; // 保证不小于1
            char operator = random.nextBoolean() ? '+' : '-';
            int result;
            switch (operator) {
                case '+':
                    result = num1 + num2;
                    break;
                case '-':
                    result = num1 - num2;
                    if (result < 0) { // 保证结果非负
                        num1 = num2;
                        num2 = result;
                        operator = '+';
                        result = num1 + num2;
                    }
                    break;
                default:
                    throw new IllegalStateException("Unexpected value: " + operator);
            }
            System.out.println("(" + num1 + " " + operator + " " + num2 + ") = " + result);
        }
    }
}